package com.ccc.boot.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 在线登录用户
 *
 * @author superC
 * @version 2.0.0
 * @date 2022/5/1
 */

@TableName("sys_user_online")
public class SysUserOnline implements Serializable {

    private static final long serialVersionUID = 4992050487163796430L;


    /**
     * 登录用户的TOKEN
     */
    @TableId
    private String id;

    /**
     * 客户端类型（1 web端；2 APP）
     */
    @TableField("client_type")
    private Integer clientType;

    /**
     * 登录用户账号
     */
    private String username;

    /**
     * 用户真实名称
     */
    @TableField("real_name")
    private String realName;

    /**
     * 登录用户的IP
     */
    private String ip;

    /**
     * 登录所在地
     */
    private String address;

    /**
     * 运营商
     */
    private String isp;

    /**
     * 用户代理
     */
    @TableField(value = "user_agent")
    private String browser;

    /**
     * 登录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "login_time")
    private LocalDateTime loginTime;

    /*  ********* getter/setter *********** */

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getClientType() {
        return clientType;
    }

    public void setClientType(Integer clientType) {
        this.clientType = clientType;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getIsp() {
        return isp;
    }

    public void setIsp(String isp) {
        this.isp = isp;
    }

    public String getBrowser() {
        return browser;
    }

    public void setBrowser(String browser) {
        this.browser = browser;
    }

    public LocalDateTime getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(LocalDateTime loginTime) {
        this.loginTime = loginTime;
    }
}
